var e = require;
var t = module;
var o = exports;
var n,
    i = o,
    a =
        ((n = function (e, t) {
            return (n =
                Object.setPrototypeOf ||
                ({__proto__: []} instanceof Array &&
                    function (e, t) {
                        e.__proto__ = t;
                    }) ||
                function (e, t) {
                    for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o]);
                })(e, t);
        }),
        function (e, t) {
            function o() {
                this.constructor = e;
            }
            n(e, t), (e.prototype = null === t ? Object.create(t) : ((o.prototype = t.prototype), new o()));
        }),
    r = function (e, t, o, n) {
        var i,
            a = arguments.length,
            r = a < 3 ? t : null === n ? (n = Object.getOwnPropertyDescriptor(t, o)) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, o, n);
        else
            for (var s = e.length - 1; s >= 0; s--)
                (i = e[s]) && (r = (a < 3 ? i(r) : a > 3 ? i(t, o, r) : i(t, o)) || r);
        return a > 3 && r && Object.defineProperty(t, o, r), r;
    };
Object.defineProperty(i, "__esModule", {value: !0});
var s = e("BaseComponent"),
    c = cc._decorator,
    l = c.ccclass,
    d = c.property,
    u = (function (e) {
        function t() {
            var t = (null !== e && e.apply(this, arguments)) || this;
            return (t.lab_content = null), t;
        }
        var o;
        return (
            a(t, e),
            (o = t),
            (t.prototype.start = function () {
                var e = this;
                if (o._oldToast) {
                    var t = o._oldToast;
                    (o._oldToast = null),
                        cc.Tween.stopAllByTarget(t),
                        cc
                            .tween(t)
                            .to(0.1, {opacity: 0})
                            .call(function () {
                                t.destroy();
                            })
                            .start();
                }
                (o._oldToast = this.node),
                    (this.lab_content.string = this.param.text || ""),
                    cc
                        .tween(this.node)
                        .to(0.25, {opacity: 255})
                        .delay(this.param.duration)
                        .to(0.25, {opacity: 0})
                        .call(function () {
                            e.node.destroy(), (o._oldToast = null);
                        })
                        .start();
            }),
            (t._oldToast = null),
            r([d(cc.Label)], t.prototype, "lab_content", void 0),
            (o = r([l], t))
        );
    })(s.default);
i.default = u;
